package router

import (
	"github.com/gin-gonic/gin"
	apis "vrcm/src/vrcm/app/admin/apis/domain"
	"vrcm/src/vrcm/app/admin/router"
)

func init() {
	router.NoCheckRole = append(router.NoCheckRole, registerCertificateRouter)
}

// registerCertificateRouter
func registerCertificateRouter(v1 *gin.RouterGroup) {
	api := apis.Certificate{}
	r := v1.Group("/certificate")
	{
		r.POST("get-list", api.GetPage)
		r.GET("/:id", api.Get)
		r.POST("/get-by-cert-id", api.GetByCertId)
		r.POST("/insert", api.Insert)
		r.POST("/save", api.Update)
		r.POST("/delete", api.Delete)
		r.POST("/refresh", api.Refresh)
		r.POST("/refresh-with-task-id", api.RefreshWithTaskId)
		r.POST("/get-refresh-record", api.GetRefreshRecord)
		r.POST("/get-refresh-record-page", api.GetRefreshRecordPage)
		r.POST("/cancel-certificate-domain", api.CancelCertificateDomain)
		r.POST("/check-pem", api.CheckPem)
		r.POST("/delete-by-cert-id", api.RemoveByCertId)
	}
}
